<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center templePreview_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub templePreview_fd0_0'>
          <view class='flex flex-wrap align-center templePreview_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  templePreview_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='templePreview_fd0_0_c1_c0'>{{$t('寺院巡礼')}}</text>
          </view>
          <view class='flex flex-wrap align-center justify-end templePreview_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center">
        <view>
          <benben-flex-tabs class-name='templePreview_benbenTabsfd1_0' v-model="tabls" ref="benben_tabsfd1_0"
            select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='false' :top='0'
            :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd1_0">

            <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
              class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd1_0.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex align-center flex ">
                  <template v-for='(item,key0) in templeList'>
                    <view :key='key0'
                      :class="{ 'checkTitlefd1_0': tabls == item.aid, 'flex flex-wrap align-center templePreview_titlefd1_0_c3': true }"
                      @tap="getInfo(item.aid,key0)" :id="`benben_tabsfd1_0-title-item-${item.aid}`">

                      <text>{{item.name}}</text>

                    </view>
                  </template>
                </view>
                <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
                  id="benben_tabsfd1_0-line"
                  class="benben-tabs-line flex benben-flex-tabs-line templePreview_linefd1_0"></view>
              </view>
            </scroll-view>

          </benben-flex-tabs>

        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->

      <view class="flex flex-direction flex-wrap align-stretch justify-end benben-flex-layout templePreview_flex_2">
        <image class='bgimage' mode="aspectFill" :src='templeInfo.img' @click="preImage"></image>
        <view class='flex flex-direction flex-wrap align-stretch templePreview_fd2_0'>
          <view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="navigateTo"
            :data-url="`/pages/shouye/templtClassification/templtClassification?id=${templeInfo.aid}`">
            <text class='templePreview_fd2_0_c0_c0'>{{templeInfo.name}}</text>
            <text class='templePreview_fd2_0_c0_c1'>{{$t('查看详情')}}</text>
            <image class='templePreview_fd2_0_c0_c2' mode="aspectFit" :src='STATIC_URL+"69.png"'></image>
          </view>
          <view class='flex flex-wrap align-start templePreview_fd2_0_c1'>
            <view class='flex-sub text-cut-3 templePreview_fd2_0_c1_c0'>
              <text class='templePreview_fd2_0_c1_c0_c0'>{{templeInfo.text}}</text>
            </view>
            <image class='templePreview_fd2_0_c1_c1' mode="aspectFit" :src='templeInfo.img'></image>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "tabsInfofd1_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "tabls": "1",
        "templeList": [],
        templeInfo: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      this.getTempleFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      preImage() {
        uni.previewImage({
          urls: [this.templeInfo.img],
          current: 0
        })
      },
      getInfo(aid, key0) {
        this.tabls = aid
        this.templeInfo = this.templeList[key0]
      },
      //获取寺庙预览
      async getTempleFunc() {
        //请求方法
        //数据验证

        let datatempleList = await this.$api.get(global.apiUrls.post65896480a5f98, {

        });

        if (datatempleList.data.code != 1) {
          this.$message.info(datatempleList.data.msg);
          return
        }
        let infotempleList = datatempleList.data;
        this.templeList = infotempleList.data

        if (this.templeList) {
          this.tabls = this.templeList[0].aid
          this.templeInfo = this.templeList[0]
          console.log('templeInfo', this.templeInfo)
        }
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(247, 243, 237, 1);
    background-size: 100% 100vh;
  }

  .templePreview_flex_0 {
    border-bottom: 1px solid #eee;
    background: rgba(247, 243, 237, 1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .templePreview_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .templePreview_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .templePreview_fd0_0_c0 {
    width: 120rpx;
  }

  .templePreview_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .templePreview_titlefd1_0_c3 {
    margin: 0rpx 60rpx 0rpx 40rpx;
  }

  .templePreview_linefd1_0 {
    background: rgba(145, 47, 34, 1);
    width: 16rpx;
    height: 16rpx;
    top: 72rpx;
    background-size: 100% auto !important;
    border-radius: 100rpx;
  }

  .checkTitlefd1_0 {
    font-weight: 700 !important;
    font-size: 28rpx !important;
    color: #912F22 !important;
  }

  ::v-deep .templePreview_benbenTabsfd1_0 {
    width: 750rpx;
    height: 90rpx;
    white-space: nowrap;
    text-align: center;
    font-size: 28rpx;
    font-weight: 400;
    color: #666666;
  }

  .bgimage {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
  }

  .templePreview_flex_2 {
    // background: url(image-path('67.png')) no-repeat;
    // margin: 32rpx 0rpx 0rpx 0rpx;
    width: 100vw;
    height: 100vh;
    position: relative;



    // padding: 0rpx 32rpx 32rpx 32rpx;
  }

  .templePreview_fd2_0_c1_c1 {
    width: 119rpx;
    height: 119rpx;
    border-radius: 24rpx;
    margin: 0rpx 0rpx 0rpx auto;
  }

  .templePreview_fd2_0_c1_c0_c0 {
    color: #FFFFFF;
    font-size: 26rpx;
    font-weight: 400;
    line-height: 40rpx;
  }

  .templePreview_fd2_0_c1_c0 {
    margin: 0rpx 44rpx 0rpx 0rpx;
  }

  .templePreview_fd2_0_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .templePreview_fd2_0_c0_c2 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .templePreview_fd2_0_c0_c1 {
    margin: 0rpx 0rpx 0rpx auto;
    color: #FFFFFF;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .templePreview_fd2_0_c0_c0 {
    color: #FFFFFF;
    font-size: 36rpx;
    font-weight: 700;
    line-height: 42rpx;
  }

  .templePreview_fd2_0 {
    width: 686rpx;
    position: fixed;
    bottom: 50rpx;
    left: 32rpx;
    background: url(image-path('68.png')) no-repeat;
    background-size: 100% auto;
    border-radius: 40rpx;
    padding: 32rpx 24rpx 32rpx 32rpx;
  }
</style>
